package com.ruoyi.user.controller;

import com.ruoyi.common.core.domain.IdVo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.UserPropertyVo;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.user.service.TbUserPropertyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 咸鱼
 * @version 1.0
 * @description: TODO
 * @date 2023/1/13 10:18
 */
@RestController
@RequestMapping("/userProperty")
public class TbUserPropertyController {

    @Autowired
    private TbUserPropertyService tbUserPropertyService;

    @PostMapping("/addUserProperty")
    public R addUserProperty(UserPropertyVo userPropertyVo){
        return tbUserPropertyService.addUserProperty(userPropertyVo);
    }

    @PostMapping("/selectUserPropertyByUserId")
    public AjaxResult selectUserPropertyByUserId(@RequestBody IdVo idVo){
        return tbUserPropertyService.selectUserPropertyByUserId(idVo);
    }

    @PostMapping("/deleteUserPropertyById")
    public R deleteUserPropertyById(@RequestBody IdVo idVo){
        return tbUserPropertyService.deleteUserPropertyById(idVo);
    }

    @PostMapping("updateOfUserProperty")
    public R updateOfUserProperty(@RequestBody UserPropertyVo userPropertyVo){
        return tbUserPropertyService.updateOfUserProperty(userPropertyVo);
    }
}
